package com.chenyi.file.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix="file")
@PropertySource(value = { "classpath:plugin-file.yml" })
public class FileConfig {

    private static Integer index;

    private static Boolean uploadCompress;

    public static Integer getIndex() {
        return index;
    }

    @Value("${index}")
    public  void setIndex(Integer index) {
        FileConfig.index = index;
    }

    public static Boolean getUploadCompress() {
        return uploadCompress;
    }

    @Value("${uploadCompress}")
    public  void setUploadCompress(Boolean uploadCompress) {
        FileConfig.uploadCompress = uploadCompress;
    }
}
